cmake_minimum_required(VERSION 3.0.0)
project(test_boost VERSION 0.1.0 LANGUAGES C CXX)

# set(CMAKE_CXX_STANDARD 11)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -pthread")

# ${CMAKE_CURRENT_SOURCE_DIR} 当前cmakelists.txt所在目录
# CMAKE_CURRENT_SOURCE_DIR ==== /home/ros/code_/code/test_boost
# CMAKE_CURRENT_BINARY_DIR ==== /home/ros/code_/code/test_boost/build
# PROJECT_SOURCE_DIR ==== /home/ros/code_/code/test_boost
# PROJECT_BINARY_DIR ==== /home/ros/code_/code/test_boost/build
message("CMAKE_CURRENT_SOURCE_DIR ==== " ${CMAKE_CURRENT_SOURCE_DIR})
message("CMAKE_CURRENT_BINARY_DIR ==== " ${CMAKE_CURRENT_BINARY_DIR})
message("PROJECT_SOURCE_DIR ==== " ${PROJECT_SOURCE_DIR})
message("PROJECT_BINARY_DIR ==== " ${PROJECT_BINARY_DIR})


include_directories(${PROJECT_SOURCE_DIR}/include)

find_package(Boost REQUIRED COMPONENTS
    system
    thread
    chrono
)

message("Boost_INCLUDE_DIRS =  "${Boost_INCLUDE_DIRS})
message("Boost_LIBRARIES_DIRS =  "${Boost_LIBRARY_DIRS})

include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})


set(SRC 
    src/main.cpp
    src/test_template.cpp
    src/test_boost.cpp
)

add_executable(test_boost ${SRC})
add_executable(client src/test_client_and_server/test_client.cpp)
add_executable(server src/test_client_and_server/test_server.cpp)
add_executable(json src/test_json.cpp)

# Boost_LIBRARIES =  Boost::system Boost::thread Boost::chrono
message("Boost_LIBRARIES =  "${Boost_LIBRARIES})

target_link_libraries(test_boost
    ${Boost_LIBRARIES}
)

target_link_libraries(json
    ${Boost_LIBRARIES}
)

target_link_libraries(client
    ${Boost_LIBRARIES}
)

target_link_libraries(server
    ${Boost_LIBRARIES}
)